import fetch from '@/common/utils/fetch';

// 登录
export const login = (body = {}) => fetch('/mweb/sys/login', {
    body: {
        transId: '14010001',
        ...body,
    },
});
// 退出
export const logout = (body = {}) => fetch('/mweb/sys/logout', {
    body: {
        transId: '14010003',
        ...body,
    },
});
// 获取登录信息
export const getLoginInfo = (body = {}) => fetch('/mweb/sys/index', {
    body: {
        transId: '14010004',
        ...body,
    },
});

// 获取用户列表
export const getUserList = (body = {}) => fetch('/mweb/user/list', {
    body: {
        transId: '14030001',
        ...body,
    },
});
// 获取用户
export const getUser = (body = {}) => fetch('/mweb/user/query', {
    body: {
        transId: '14030002',
        ...body,
    },
});
// 添加/修改用户
export const updateUser = (body = {}) => fetch('/mweb/user/update', {
    body: {
        transId: '14030003',
        ...body,
    },
});
// 修改用户状态
export const updateUserState = (body = {}) => fetch('/mweb/user/updateStatus', {
    body: {
        transId: '14030005',
        ...body,
    },
});
// 删除用户
export const delUser = (body = {}) => fetch('/mweb/user/delete', {
    body: {
        transId: '14030004',
        ...body,
    },
});

// 重置密码
export const resetUserPassword = (body = {}) => fetch('/mweb/user/reset', {
    body: {
        transId: '14030006',
        ...body,
    },
});

// 获取角色列表
export const getRoleList = (body = {}) => fetch('/mweb/role/list', {
    body: {
        transId: '14040001',
        ...body,
    },
});
// 获取角色
export const getRole = (body = {}) => fetch('/mweb/role/query', {
    body: {
        transId: '14040002',
        ...body,
    },
});
// 添加/修改角色
export const updateRole = (body = {}) => fetch('/mweb/role/update', {
    body: {
        transId: '14040003',
        ...body,
    },
});
// 修改角色状态
export const updateRoleState = (body = {}) => fetch('/mweb/role/updateStatus', {
    body: {
        transId: '14040005',
        ...body,
    },
});
// 删除角色
export const delRole = (body = {}) => fetch('/mweb/role/delete', {
    body: {
        transId: '14040004',
        ...body,
    },
});
// 获取角色成员
export const getRoleUsers = (body = {}) => fetch('/mweb/role/userlist', {
    body: {
        transId: '14040007',
        ...body,
    },
});

// 获取菜单列表
export const getPermissionList = (body = {}) => fetch('/mweb/menu/list', {
    body: {
        transId: '14020001',
        ...body,
    },
});
// 获取菜单
export const getPermission = (body = {}) => fetch('/mweb/menu/query', {
    body: {
        transId: '14040002',
        ...body,
    },
});
// 添加/修改菜单
export const updatePermission = (body = {}) => fetch('/mweb/menu/update', {
    body: {
        transId: '14040003',
        ...body,
    },
});
// 删除菜单
export const delPermission = (body = {}) => fetch('/mweb/menu/delete', {
    body: {
        transId: '14040004',
        ...body,
    },
});

